<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<script>
    function diaryDelete(diaryId) {
        if(confirm("您确定要删除这条记录吗？")){
            window.location.href="diary?action=delete&diaryId="+diaryId;
        }
    }
</script>
<html>
<head>
    <title>Title</title>
</head>
<body>
<div class="data_list">
    <div class="data_list_title">
        <img src="${pageContext.request.contextPath}/static/images/diary_show_icon.png"/>日记信息
    </div>
    <div class="diary_datas">
        <div class="diary_title">
            <h3>${diary.title}</h3>
        </div>
        <div class="diary_info">
            发布时间:『<fmt:formatDate value="${diary.releaseDate}" type="date" pattern="yyyy-MM-dd HH:mm:ss"/>』&nbsp;&nbsp;
            日志类别:${diary.typeName}
        </div>
        <div class="diary_content">
            ${diary.content}
        </div>
        <div class="diary_action">
             <button class="btn btn-primary" type="button" onclick="window.location.href='diary?action=preSave&diaryId=${diary.diaryId}'">修改</button>
             <button class="btn btn-primary" type="button" onclick="window.history.back()">返回</button>
             <button class="btn btn-danger" type="button" onclick="diaryDelete(${diary.diaryId})">删除</button>
        </div>
    </div>
</div>
</body>
</html>
